/**
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '../../../styles/variables';

.input {
  position: relative;
  width: 100%;

  input {
    width: 100%;
    font-size: 18px;
    line-height: 27px;
    padding: 16px 56px 16px 16px;
    color: $dark_orange;
    background-color: $white;
    border: 1px solid $dark_orange;
    box-shadow: 0px 6px 0px $drop_shadow;
    transition: 300ms ease;
    overflow: hidden;
    border-radius: 0px;
    appearance: none;

    &::placeholder {
      color: $orange;
      opacity: 1;
    }
  }

  .submit {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    width: 64px;
    height: 100%;
    transition: 300ms ease;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0.4;
    pointer-events: none;

    span {
      color: $orange;
      font-size: 24px;
    }
  }

  &.focused {
    input {
      transform: translateY(-4px);
      box-shadow: 0px 10px 0px $drop_shadow;
    }
    .submit {
      pointer-events: auto;
      transform: translateY(calc(-50% - 4px));
      opacity: 1;
    }
  }

  &.noFocus + div > button {
    opacity: 1;
  }

  &.disabled {
    input {
      transform: translateY(0px);
      box-shadow: 0px 6px 0px $drop_shadow;
      opacity: 0.5;
      pointer-events: none;
    }

    .submit {
      transform: translateY(-50%);
      opacity: 0.4;
      pointer-events: none;
    }
  }
}
